package io.renren.modules.dishes.controller;


import edu.wfu.preparedDishes.common.utils.R;

import io.renren.modules.dishes.entity.ClassificationEntity;
import io.renren.modules.dishes.service.impl.ClassficationServiceImpl;
import io.renren.modules.merchant.service.impl.MerchantServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;



@RestController
@RequestMapping("/web/classfication")
public class ClassficationController {
    @Autowired
    private ClassficationServiceImpl classficationService;
    @Autowired
    private MerchantServiceImpl merchantService;


    @GetMapping("/list")
    public R getClassfication(){
//        Long userId = getUserId();
        Long userId=3L;
        String merchantId = merchantService.getMerchantByUserId(userId).getMerchantId();
        List<ClassificationEntity> list = classficationService.getClassfication(merchantId);
        return R.ok().put("list",list);
    }
}
